//
//  GoodCategoryListCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/26.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "GoodCategoryListCell.h"
#import "OneGoodsModel.h"

@interface GoodCategoryListCell ()
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *topImageView;

@property (weak, nonatomic) IBOutlet UILabel *goodsNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *goodsPriceLabel;

@end

@implementation GoodCategoryListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.bgView.backgroundColor = [UIColor whiteColor];

    self.contentView.backgroundColor = lineGray;
    
    self.goodsNameLabel.font = MYFONT(14);
    
    self.goodsPriceLabel.font = MYFONT(16);
    
    self.goodsPriceLabel.textColor = [UIColor redColor];
    
    self.goodsNameLabel.text = @"vivo X20 全面屏手机 全网通 4GB + 64GB磨砂黑...";
    
    self.goodsPriceLabel.text = @"2999.00P";
    
    
//    [self.topImageView sd_setImageWithURL:[NSURL URLWithString:@"http://pic.chinaz.com/2017/1109/17110909242561246.jpg"] placeholderImage:nil];
    // Initialization code
}


- (void)setModel:(OneGoodsModel *)model{
    _model = model;
    
//    if (_model.goods_price == nil) {
//        self.goodsNameLabel.hidden = YES;
//        self.topImageView .hidden = YES;
//        self.goodsPriceLabel.hidden = YES;
//    } else {
//        self.goodsNameLabel.hidden = NO;
//        self.topImageView .hidden = NO;
//        self.goodsPriceLabel.hidden = NO;
//    }
    
    
    self.goodsNameLabel.text = _model.goods_name;
    
    [self.topImageView sd_setImageWithURL:[NSURL URLWithString:_model.pic_cover_small] placeholderImage:nil];
    
    self.goodsPriceLabel.text = [NSString stringWithFormat:@"%@P",_model.price];
    
    
}

@end
